package cbfg.vbinding

import javafx.fxml.FXML
import javafx.fxml.FXMLLoader
import javafx.scene.Scene
import javafx.scene.control.Label
import javafx.stage.Stage

class HelloController {
    @FXML
    private lateinit var welcomeText: Label

    @FXML
    private fun onHelloButtonClick() {
        welcomeText.text = "Welcome to JavaFX Application!"
    }

    companion object {
        fun show(stage: Stage) {
            val fxmlLoader = FXMLLoader(HelloApplication::class.java.getResource("hello-view.fxml"))
            val scene = Scene(fxmlLoader.load(), 320.0, 240.0)
            stage.title = "Hello!"
            stage.scene = scene
            stage.show()
        }
    }
}